<html>
<head><meta charset="utf-8"><title>Can you specify a -Z flag via `.cargo/config.toml`? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Can.20you.20specify.20a.20-Z.20flag.20via.20.60.2Ecargo.2Fconfig.2Etoml.60.3F.html">Can you specify a -Z flag via `.cargo/config.toml`?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="207604449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Can%20you%20specify%20a%20-Z%20flag%20via%20%60.cargo/config.toml%60%3F/near/207604449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Can.20you.20specify.20a.20-Z.20flag.20via.20.60.2Ecargo.2Fconfig.2Etoml.60.3F.html#207604449">(Aug 21 2020 at 06:45)</a>:</h4>
<p>What I would like is for <code>cargo build</code> to be <code>cargo build -Z build-std=core --target thumbv4t-none-eabi</code></p>
<p>Currently my <code>.cargo/config.toml</code> file has this:</p>
<div class="codehilite"><pre><span></span><code><span class="k">[alias]</span>
<span class="n">b</span> <span class="o">=</span> <span class="k">[&quot;build&quot;, &quot;-Z&quot;, &quot;build-std=core&quot;]</span>

<span class="k">[build]</span>
<span class="n">target</span> <span class="o">=</span> <span class="k">[&quot;thumbv4t-none-eabi&quot;]</span>
<span class="n">rustflags</span> <span class="o">=</span> <span class="k">[&quot;-Clink-arg=-Tlinker_script.ld&quot;]</span>
</code></pre></div>


<p>but I'd like to know if there's some other field I can set to make the <code>build-std=core</code> always be applied. There didn't <em>seem</em> to be in the cargo book, but sometimes it's not fully up to date.</p>



<a name="207623443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Can%20you%20specify%20a%20-Z%20flag%20via%20%60.cargo/config.toml%60%3F/near/207623443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Can.20you.20specify.20a.20-Z.20flag.20via.20.60.2Ecargo.2Fconfig.2Etoml.60.3F.html#207623443">(Aug 21 2020 at 11:25)</a>:</h4>
<p>This should work:</p>
<div class="codehilite"><pre><span></span><code><span class="k">[unstable]</span>
<span class="n">build-std</span> <span class="o">=</span> <span class="k">[&quot;core&quot;]</span>
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>